/* Check galois arithmetic operations.*/
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include "reed_sol-2.h"
#include "jerasure-2.h"
#include "galois-2.h"

using namespace std;

int main( int argc, char** argv )
{
	JER_Matrix *jm;

	int m = atoi( argv[1] );
	int k = atoi( argv[2] );
	int w = atoi( argv[3] );

	fprintf( stdout, "%d * %d = %d\n", m, k, galois_single_multiply( m, k, w ) );
	fprintf( stdout, "%d / %d = %d\n", m, k, galois_single_divide( m, k, w ) );
	fprintf( stdout, "log(%d) = %d\n", m, galois_log( m, w ) );
	fprintf( stdout, "ilog(%d) = %d\n", k, galois_log( k, w ) );
	fprintf( stdout, "%u * %u = %u\n", m, k, galois_single_multiply( m, k, w + 16 ) );
	fprintf( stdout, "%u / %u = %u\n", m, k, galois_single_divide( m, k, w + 16 ) );
	fprintf( stdout, "%u * %u = %u\n", m, k, galois_single_multiply( m, k, 32 ) );
	fprintf( stdout, "%u / %u = %u\n", m, k, galois_single_divide( m, k, 32 ) );
	return 0;
}
